<template>
	<view class="settled">
		<view class="title txtali">
			商家入驻
		</view>
		<view class="ruzhu_img">
			<image class="w100 h100" src="https://sz.vvv5g.com/assets/img/wxImg/ruzhu.png" mode=""></image>
		</view>
		<view class="ruzhuben_txt f500 txtali">
			入驻本平台
		</view>
		<view class="xinxi_txt f500 s30 txtali">
			填写商家信息，进行入驻申请
		</view>
		<view class="btn s32 fblod familytow txtali" @click="onDisplay">
			点击入驻
		</view>
		<view class="zhezhao" v-if="show">
			<view class="c_box">
				<view class="c_title txtali">
					入驻说明
				</view>
				<view class="c_txt scrollnobar">
					<rich-text :nodes="content"></rich-text>
				</view>
				<view class="btn_box flex">
					<view class="quxiao_btn s32 fblod familytow txtali" @click="onDisplay">
						取消
					</view>
					<view class="quxiao_btn_v s32 fblod familytow txtali" @click="goDetail">
						确定
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				content: ''
			}
		},
		onLoad() {
			this.getText()
		},
		onShow() {
			this.getApplyState()
		},
		methods: {
			getApplyState() {
				this.$request({
					url: 'shop/applyState',
					method: 'POST',
				}).then(res => {
					if(res.statusCode == 200) {
						if(res.data.code == 1){
							uni.showModal({
								title: '提示',
								content: res.data.msg,
								showCancel: false,
								success: function (res) {
									if (res.confirm) {
										uni.navigateBack({})
									}
								}
							});
						}else if(res.data.code == 0){
							uni.showToast({
								title: "你提交的申请未通过审核！",
								icon: "none",
								duration: 3000
							})
						}
					}
				})
			},
			onDisplay() {
				this.show = !this.show
			},
			goDetail() {
				uni.navigateTo({
					url:"./merchantInformation"
				})
				this.show = !this.show
			},
			getText() {
				this.$request({
					url: 'common/config',
					method: 'POST',
					data: {
						keyword: 'entry_desc'
					}
				}).then(res => {
					this.content = res.data.data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.settled {
		overflow: hidden;

		.title {
			font-size: 60upx;
			font-family: Alibaba PuHuiTi-Bold, Alibaba PuHuiTi;
			font-weight: bold;
			color: #EBBE87;
			margin-top: 92upx;
		}

		.ruzhu_img {
			width: 568upx;
			height: 518upx;
			margin: 92upx auto;
		}

		.ruzhuben_txt {
			font-size: 44upx;
			font-family: Alibaba PuHuiTi-Medium, Alibaba PuHuiTi;
			color: #666666;
			margin-top: 110upx;
		}

		.xinxi_txt {
			font-family: Alibaba PuHuiTi-Medium, Alibaba PuHuiTi;
			color: #999999;
			margin-top: 18upx;
		}

		.btn {
			width: 686upx;
			height: 100upx;
			background: #EBBE87;
			border-radius: 50upx 50upx 50upx 50upx;
			margin: 94upx auto;
			color: #FFFFFF;
			line-height: 100upx;
		}

		.zhezhao {
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.5);
			position: fixed;
			top: 0;

			.c_box {
				width: 624upx;
				background: #FFFFFF;
				border-radius: 32upx 32upx 32upx 32upx;
				margin: 40% auto;
				overflow: hidden;

				.c_title {
					font-size: 42upx;
					font-family: HYYakuHei-75W, HYYakuHei;
					font-weight: normal;
					color: #844902;
					margin-top: 64upx;
				}

				.c_txt {
					width: 550upx;
					height: 500upx;
					margin: 48upx auto;
					margin-bottom: 0;
					overflow-y: scroll;
				}

				.btn_box {
					margin-top: 40upx;

					.quxiao_btn {
						width: 312upx;
						height: 100upx;
						background: #CCCCCC;
						border-radius: 0upx 0upx 0upx 32upx;
						color: #FFFFFF;
						line-height: 100upx;
					}

					.quxiao_btn_v {
						width: 312upx;
						height: 100upx;
						background: #EBBE87;
						border-radius: 0upx 0upx 32upx 0upx;
						line-height: 100upx;
						color: #844902;
					}
				}
			}
		}
	}
</style>
